﻿using System;
using System.Diagnostics;
using JESAI.HttpRequestMonitor.Core.Abstracts;
using JESAI.HttpRequestMonitor.Grpc;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;

namespace Microsoft.Extensions.DependencyInjection
{
    public static class HttpRequestMonitorMonitorMiddlewareExtensions
    {
        public static IHttpRequestMonitorBuilder UseHttpRequestMonitorGrpc(this IHttpRequestMonitorBuilder builder)
        {
            builder.Services.AddGrpc(x => { x.Interceptors.Add<HttpRequestMonitorGrpcLoggerInterceptor>(); });

            return builder;
        }

    }
}